package cn.edu.ujn.bmis.service.imp;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import cn.edu.ujn.bmis.dao.DonatorDao;
import cn.edu.ujn.bmis.model.Donator;
import cn.edu.ujn.bmis.service.DonatorManager;

@Component("donatorManager")
public class DonatorManagerImp implements DonatorManager {
	
	private DonatorDao donatorDao;

	public boolean addDonator(Donator donator) {
		
		return donatorDao.saveDonator(donator);
	}

	public DonatorDao getDonatorDao() {
		return donatorDao;
	}
	
	public List<Donator> findDonator(String hql) {
		
		return donatorDao.findDonator(hql);
	}
	
	@Resource(name="donatorDao")
	public void setDonatorDao(DonatorDao donatorDao) {
		this.donatorDao = donatorDao;
	}

	public boolean update(String hql) {
		
		return donatorDao.update(hql);
	}

	public boolean update(Donator donator) {
		
		return donatorDao.update(donator);
	}
	
}
